function createHTTPXMLObject(){
	
	var xmlhttp = false
	
	try{
		xmlhttp = new XMLHttpRequest();// Mozilla, Safari, Firefox, etc...
	}catch(e2){
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");// Internet Explorer
		}catch(e3){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");// Internet Explorer
			}catch(e4){
				//tratamento para alguma outra forma de implementar XMLHTTP
				xmlhttp = false;
			}
		}
	}
	
	return xmlhttp;
}

function loadXSLfromXML(xslFile, xml){
	var str
	try{
		// Load XSL
		var xsl = new ActiveXObject("Microsoft.XMLDOM")
		xsl.async = false
		xsl.load(xslFile)
		// Transform
		str = xml.transformNode(xsl)
	}catch(e2){
		try{
			//for mozilla/netscape
			var xslt = document.implementation.createDocument("","",null);
			xslt.async = false;
			xslt.load(xslFile);
			var processor = new XSLTProcessor();
			processor.importStylesheet(xslt);
			var result = processor.transformToDocument(xml);
			var xmls = new XMLSerializer();
			str = xmls.serializeToString(result);
		}catch(e1){
			try{ //Safari, Google Chrome
				XmlHTTP = createHTTPXMLObject();
				XmlHTTP.open('get', xslFile, false);
				XmlHTTP.send('');
				xslt = XmlHTTP.responseXML;
				var processor = new XSLTProcessor();
				processor.importStylesheet(xslt);
				var result = processor.transformToDocument(xml);
				var xmls = new XMLSerializer();
				str = xmls.serializeToString(result);		
			} catch (e3) {
				alert("Your browser don't suport Ajax - " +  + e1.name + ". Error message: " + e1.message);
				str = ""
			}
		}
	}
	return str
}
